home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / ASSEMBLER / EXTASM / Examples / StructEx < prev   
Text File  |  1993-11-16  |  557b  |  28 lines

  1. ; Example of struct's
  2. ;------------------------
  3. #smile
  4. #quit
  5. #append <Tmp$Path>.Macros
  6.  
  7. struct mouse {
  8.    .x_pos       dcd   0
  9.    .y_pos       dcd   0
  10.    .buttons     dcd   0
  11.  
  12.    .size                               ; .size = size of struct!
  13. }
  14.  
  15. PROG_INIT
  16.  
  17.    swi      OS_Mouse
  18.    str      r0,InfoBlock+mouse.x_pos
  19.    str      r1,InfoBlock+mouse.y_pos
  20.    str      r2,InfoBlock+mouse.buttons
  21.  
  22. PROG_EXIT
  23.  
  24. .InfoBlock
  25.    dbb   mouse.size,0                  ; auto-alloc enough memory
  26.    align                               ; align, coz it might be byte-aligned!
  27.  
  28.